/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.pay.e;

import android.content.Context;
import android.location.Location;
import android.text.TextUtils;
import com.qihoo.gamecenter.sdk.common.i.k;
import com.qihoo.gamecenter.sdk.common.i.s;
import com.qihoo.gamecenter.sdk.pay.k.c;
import org.json.JSONException;
import org.json.JSONObject;

public class b {
    public static String a(Context paramContext, String paramString1, String paramString2, String paramString3,
            String paramString4, String paramString5, String paramString6, String paramString7, String paramString8,
            String paramString9, String paramString10, String paramString11) {
        return a(paramContext, paramString1, paramString2, paramString3, paramString4, paramString5, paramString6,
                paramString7, paramString8, paramString9, paramString10, paramString11, false);
    }

    public static String a(Context paramContext, String paramString1, String paramString2, String paramString3) {
        return a(paramContext, paramString1, paramString2, null, null, paramString3, null, null, null, null, null,
                null, true);
    }

    public static String a(Context paramContext, String paramString1, String paramString2) {
        return a(paramContext, paramString1, null, null, null, null, null, null, null, null, paramString2, null, false);
    }

    public static String a(Context paramContext) {
        return a(paramContext, null, null, null, null, null, null, null, null, null, null, null, false);
    }

    private static String a(Context paramContext, String paramString1, String paramString2, String paramString3,
            String paramString4, String paramString5, String paramString6, String paramString7, String paramString8,
            String paramString9, String paramString10, String paramString11, boolean paramBoolean) {
        JSONObject localJSONObject = new JSONObject();
        String str1 = k.a(s.j(paramContext));
        c.a("CreditUtil", new Object[] { "did=", str1 });
        try {
            if (!(TextUtils.isEmpty(str1))) {
                localJSONObject.put("did", str1);
                if (!(TextUtils.isEmpty(paramString1)))
                    if (paramBoolean)
                        localJSONObject.put("bindid", paramString1);
                    else
                        localJSONObject.put("bind_id", paramString1);
                if (!(TextUtils.isEmpty(paramString2)))
                    localJSONObject.put("card_no", paramString2);
                if (!(TextUtils.isEmpty(paramString3)))
                    localJSONObject.put("card_expire", paramString3);
                if (!(TextUtils.isEmpty(paramString4)))
                    localJSONObject.put("cvv2", paramString4);
                if (!(TextUtils.isEmpty(paramString5)))
                    localJSONObject.put("card_phone", paramString5);
                if (!(TextUtils.isEmpty(paramString6)))
                    localJSONObject.put("idno", paramString6);
                if (!(TextUtils.isEmpty(paramString7)))
                    localJSONObject.put("accname", paramString7);
                if (!(TextUtils.isEmpty(paramString8)))
                    localJSONObject.put("card_pwd", paramString8);
                if (!(TextUtils.isEmpty(paramString9)))
                    localJSONObject.put("cardtype", paramString9);
                if (!(TextUtils.isEmpty(paramString10)))
                    localJSONObject.put("sub_bank_code", paramString10);
                if (!(TextUtils.isEmpty(paramString11)))
                    localJSONObject.put("need_bind", paramString11);
            }
        } catch (JSONException localJSONException) {
            c.b("CreditUtil", new Object[] { localJSONException.toString() });
        }
        String str2 = localJSONObject.toString();
        c.a("CreditUtil", new Object[] { "quickInfo=", str2 });
        return com.qihoo.gamecenter.sdk.common.f.b.a().a(str2);
    }

    public static String b(Context paramContext) {
        return a(paramContext, false);
    }

    public static String c(Context paramContext) {
        JSONObject localJSONObject = new JSONObject();
        String str1 = null;
        String str2 = null;
        String str3 = null;
        String str4 = s.k(paramContext);
        String str5 = s.l(paramContext);
        String str6 = s.m(paramContext);
        String str7 = s.j(paramContext);
        String str8 = s.i(paramContext);
        Location localLocation = new Location("");
        c.a("CreditUtil", new Object[] { "start updateLocation" });
        com.qihoo.gamecenter.sdk.support.g.b.a(paramContext, localLocation);
        c.a("CreditUtil", new Object[] { "end updateLocation" });
        if ((localLocation != null) && (!(TextUtils.isEmpty(localLocation.getProvider())))) {
            c.a("CreditUtil", new Object[] { "loc=", localLocation.toString() });
            str1 = String.valueOf(localLocation.getLatitude());
            str2 = String.valueOf(localLocation.getLongitude());
            str3 = String.valueOf(localLocation.getTime());
        }
        try {
            if ((!(TextUtils.isEmpty(str1))) && (!(TextUtils.isEmpty(str2)))) {
                String str9 = str1 + "|" + str2 + "|" + str3;
                if (str9.length() > 64)
                    str9 = str9.substring(0, 64);
                localJSONObject.put("position", str9);
            }
            if (!(TextUtils.isEmpty(str4)))
                localJSONObject.put("imsi", str4);
            if (!(TextUtils.isEmpty(str5)))
                localJSONObject.put("mac", str5);
            if (!(TextUtils.isEmpty(str6)))
                localJSONObject.put("mobile_num", str6);
            if (!(TextUtils.isEmpty(str8)))
                localJSONObject.put("imei", str8);
            if (!(TextUtils.isEmpty(str7)))
                localJSONObject.put("device_id", str7);
            localJSONObject.put("device_time", System.currentTimeMillis());
        } catch (JSONException localJSONException) {
            c.b("CreditUtil", new Object[] { localJSONException.toString() });
        }
        return com.qihoo.gamecenter.sdk.common.f.b.a().a(localJSONObject.toString());
    }

    public static String a(Context paramContext, boolean paramBoolean) {
        JSONObject localJSONObject = new JSONObject();
        String str1 = null;
        String str2 = null;
        String str3 = null;
        String str4 = s.k(paramContext);
        String str5 = s.l(paramContext);
        String str6 = s.m(paramContext);
        Object localObject;
        if (!(paramBoolean)) {
            localObject = new Location("");
            c.a("CreditUtil", new Object[] { "start updateLocation" });
            com.qihoo.gamecenter.sdk.support.g.b.a(paramContext, (Location) localObject);
            c.a("CreditUtil", new Object[] { "end updateLocation" });
            if ((localObject != null) && (!(TextUtils.isEmpty(((Location) localObject).getProvider())))) {
                c.a("CreditUtil", new Object[] { "loc=", ((Location) localObject).toString() });
                str1 = String.valueOf(((Location) localObject).getLatitude());
                str2 = String.valueOf(((Location) localObject).getLongitude());
                str3 = String.valueOf(((Location) localObject).getTime());
            }
        }
        try {
            if ((!(TextUtils.isEmpty(str1))) && (!(TextUtils.isEmpty(str2)))) {
                localObject = str1 + "|" + str2 + "|" + str3;
                if (((String) localObject).length() > 64)
                    localObject = ((String) localObject).substring(0, 64);
                localJSONObject.put("position", localObject);
            }
            if (!(TextUtils.isEmpty(str4)))
                localJSONObject.put("imsi", str4);
            if (!(TextUtils.isEmpty(str5)))
                localJSONObject.put("mac", str5);
            if (!(TextUtils.isEmpty(str6)))
                localJSONObject.put("mobile_num", str6);
        } catch (JSONException localJSONException) {
            c.c("CreditUtil", new Object[] { localJSONException.toString() });
        }
        return ((String) com.qihoo.gamecenter.sdk.common.f.b.a().a(localJSONObject.toString()));
    }
}